﻿using BCCommon;
using BCCommon.Enums;
using BCDto.Sim.Admin.Admin;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCService.Sim.Admin.Admin
{
    /// <summary>
    /// 员工相关服务
    /// </summary>
    public interface IAdminService
    {
        /// <summary>
        /// 根据用户名校验员工信息是否存在
        /// </summary>
        /// <param name="loginName">员工用户名</param>
        /// <returns></returns>
        bool CheckAdminExists(string loginName);

        /// <summary>
        /// 新创建一个员工信息
        /// </summary>
        /// <param name="adminRequestDto">员工信息</param>
        /// <param name="ip">当前Ip</param>
        /// <returns></returns>
        AdminDto Add(AdminRequestDto adminRequestDto, string ip);

        /// <summary>
        /// 更新员工信息
        /// </summary>
        /// <param name="adminPutDto">员工信息</param>
        /// <returns></returns>
        AdminDto Update(AdminPutDto adminPutDto);
        /// <summary>
        /// 更新自己密码
        /// </summary>
        /// <param name="adminId">当前员工Id</param>
        /// <param name="dto">员工信息</param>
        /// <returns></returns>
        bool UpdateSelfPassword(long adminId, AdminCurrentPutDto dto);

        /// <summary>
        /// 根据员工Id获取员工信息
        /// </summary>
        /// <param name="adminId">员工Id</param>
        /// <returns></returns>
        AdminDto GetAdminInfoByAdminId(long adminId);
        /// <summary>
        /// 根据员工Id获取员工信息(无用户密码)
        /// </summary>
        /// <param name="adminId">员工Id</param>
        /// <returns></returns>
        AdminDto GetNonePasswordAdminInfoByAdminId(long adminId);
        /// <summary>
        /// 根据员工Id获取员工信息(无用户密码)
        /// </summary>
        /// <param name="adminId">员工Id</param>
        /// <param name="adminDto">当前登录人信息</param>
        /// <returns></returns>
        AdminDto GetNonePasswordAdminInfoByAdminId(long adminId, AdminDto adminDto);
        /// <summary>
        /// 根据员工登录名获取员工信息
        /// </summary>
        /// <param name="loginName">员工登录名</param>
        /// <returns></returns>
        AdminDto GetAdminInfoByLoginName(string loginName);
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="password">密码</param>
        /// <param name="ip"></param>
        /// <returns></returns>
        AdminDto Logon(string userName, string password, string ip);
        /// <summary>
        /// 分页查询员工列表信息
        /// </summary>
        /// <param name="companyId">公司Id</param>
        /// <param name="departmentId">部门Id</param>
        /// <param name="loginName">员工登录名</param>
        /// <param name="fullName">员工姓名</param>
        /// <param name="accountStatus">账号状态</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">是否按照顺序排序</param>
        /// <param name="pageIndex">分页页码</param>
        /// <param name="pageSize">分页页数</param>
        /// <returns></returns>
        PageableList<AdminDto> GetAdmins(int? companyId, int? departmentId, string loginName, string fullName, AccountStatus? accountStatus, string sortName, bool? ascending, int pageIndex = 1, int pageSize = 10);
        /// <summary>
        /// 获取员工列表
        /// </summary>
        /// <returns></returns>
        IEnumerable<AdminDto> GetAdminsForCompany();
        /// <summary>
        /// 获取员工列表
        /// </summary>
        /// <param name="companyId">公司Id</param>
        /// <returns></returns>
        IEnumerable<AdminDto> GetCompanyAdminsAsync(int companyId);


        /// <summary>
        /// 设置员工的账号状态
        /// </summary>
        /// <param name="adminId">员工Id</param>
        /// <param name="accountStatus">账号状态</param>
        /// <returns></returns>
        AdminDto SetAdminAccountStatus(long adminId, AccountStatus accountStatus);

        /// <summary>
        /// 员工修改头像
        /// </summary>
        /// <param name="adminId">员工Id</param>
        /// <param name="avatar">员工头像</param>
        /// <returns></returns>
        bool UpdateAdminAvatar(long adminId, string avatar);
        
        ///// <summary>
        ///// 获取员工和他下属的员工Id列表
        ///// </summary>
        ///// <param name="adminDto"></param>
        ///// <returns></returns>
        //List<long> GetAdminAndChildrens(AdminDto adminDto);
    }
}
